﻿/*
 * Determines whether the end of a string matches a specified string.
 */
create function [String].[EndsWith] ( @p_String nvarchar(max), @p_Term nvarchar(max) )
returns bit as
begin

  if Right( @p_String, Len( @p_Term ) ) = @p_Term
  begin
    return 1;
  end
  
  return 0;

end